const DB = require('../tools/mysql')

module.exports = async ctx => {
  ctx.body = await DB('card')
    .join('style', 'card.style', '=', 'style.id')
    .join('kind', 'card.kind', '=', 'kind.id')
    .select('card.id', 'card.title', 'style.code as style', 'card.kind', 'kind.name as kind_name', 'card.display_url')
    .where('card.show', 1)
}